# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Simon Sapin <simon dot sapin at exyr dot org>
# Contributor: Kyle Keen <keenerd@gmail.com>

pkgname=python-h11
pkgver=0.14.0
pkgrel=2
pkgdesc="A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
url="https://github.com/python-hyper/h11"
license=('MIT')
arch=('any')
depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-pytest')
source=("https://pypi.io/packages/source/h/h11/h11-$pkgver.tar.gz")
sha512sums=('6146f6441ce62ea46d824a86c1687401224ea6084ca2703b9c841dce51cdfb5de49b39a4f4a7e95efae40ed83012ea4a8641700281f728c2f580a90ce42d82a5')

build() {
  cd h11-$pkgver
  python setup.py build
}

check() {
  cd h11-$pkgver
  pytest
}

package_python-h11() {
  cd h11-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}
